Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

feat(exporter) add url location and GET param counters, with regex extract #116

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

samsk
Copy link
Contributor

@samsk samsk commented Mar 18, 2021

Hello,
this is a second revamp of pull request #113, implementing poor man`s alternative for URL endpoint usage tracking.

New features:

  • per-url param metric

    • collects hits per first defined url param from param_collect_list, attaching its value as param label
    • creates kong_http_url_param_total or kong_http_url_param_consumer_total depending on per_consumer switch
    • optionally extracts/validates param label value according to param_value_extract regexp, (to avoid possible problems with metric cardinality)
  • per-url location metric

    • collects hits per ngx.var.uri ($uri) location, attaching its value as location label
    • creates kong_http_url_location_total or kong_http_url_location_consumer_total depending on per_consumer switch
    • optionally extracts/validates location label value according to location_extract regexp

These new metrics make sense especially for people that don't want to setup/run/maintain additional log-collection/extraction system (like fluentd/splunk) or implement any other kind of instrumentation systems. With this, they can still have at least a basic insight about per-consumer usage of their services identified by URL param and/or URL location (part).

Ideally, this features should be used together with consumer authentication (as it is in our use case), to further reduce possible metrics overpopulation problems.

Thank you

@gszr
Copy link
Member

gszr commented Aug 7, 2021

Hi @samsk, thanks for this PR. We are in the process of moving some external plugins into the Kong main repository. We have just merged this one into Kong. Issues were also moved. We have created a card to review this PR; once we do, we will cherry-pick changes here into Kong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants